#include <iostream>
#include "workerManager.h"
#include "boss.h"
#include "manager.h"
#include "staff.h"

using namespace std;

// 测试多态
void test01(){
    Worker * worker = nullptr;
    worker = new Boss(1, "张三", 1);
    worker->showInfo();
    delete worker;

    worker = new Manager(2, "李四", 2);
    worker->showInfo();
    delete worker;

    worker = new Staff(3, "王五", 3);
    worker->showInfo();
    delete worker;
}

int main() {

    WorkerManager wm;

    int choice = 0;
    while (true) {
        wm.showMenu();
        cout << "请输入选择:";
        cin >> choice;
        switch (choice) {
            case 1:     //退出系统
                wm.exitSystem();
                break;
            case 2:     //增加职工
                wm.addEmp();
                break;
            case 3:     //显示职工信息
                wm.showEmp();
                break;
            case 4:     //删除职工
                wm.deleteEmp();
                break;
            case 5:     //修改职工信息
                wm.modifyEmp();
                break;
            case 6:     //查找职工信息
                wm.findEmp();
                break;
            case 7:     //按照编号排序
                wm.sortEmp();
                break;
            case 8:     //清空文档
                wm.cleanFile();
                break;
            default:
//                system("cls");
                cout << "输入有误，重新输入" << endl;
                break;
        }
    }
    return 0;
}
